<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <%@ include file="/WEB-INF/include/commoncss.jsp"%>
    <script type="text/javascript"
            src="${ctx}/javascript/laydate/laydate.js"></script>
</head>
<body>
<article class="page-container">
    <div action="" class="form form-horizontal" id="scheduleAdd">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>账号：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="YHZH" name="YHZH" value="${recorder.YHZH}" class="input-text" disabled/>
            </div>
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>姓名：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="name" name="name" value="${recorder.name}" class="input-text" />
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>用户类别：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="JSDM" name="JSDM" value="${recorder.JSMC}" class="input-text" disabled/>
            </div>

            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>学院：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="college" name="college" value="${recorder.college}" class="input-text" />
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>专业：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="speciality" name="speciality" value="${recorder.speciality}" class="input-text" />
            </div>
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>班级：</label>
            <div class="formControls col-xs-7 col-sm-2">
                <input onkeyup="if(this.value.length>1) {
                this.value=this.value.substr(0,1)};this.value=this.value.replace(/[^\d]/g,'');" id="banji" name="banji" value="${fn:substring(recorder.banji,0,1)}" class="input-text" />
            </div>
            <label class="form-label col-xs-1 col-sm-1">班</label>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">年级：</label>
            <div class="formControls col-xs-7 col-sm-2">
                <input onkeyup="if(this.value.length>4) {
                this.value=this.value.substr(0,4)};this.value=this.value.replace(/[^\d]/g,'');" id="grade" name="grade" value="${fn:substring(recorder.grade,0,4)}" class="input-text" />
            </div>
            <label class="form-label col-xs-1 col-sm-1">级</label>
        </div>

        <div class="row cl">
            <div class="col-xs-8  col-xs-offset-5 ">
                <button value="${recorder.YHZH}" type="button" class="btn btn-success radius" onClick="update_politic(this.value)">提交</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button onClick="layer_close();" class="btn btn-default radius" type="button"> 关闭</button>
            </div>
        </div>
    </div>
    <%@ include file="/WEB-INF/include/commonjs.jsp"%>
    <script type="javascript">
        function  change_content(t,n) {
            if(t.value.length>n) {
                t.value=t.value.substr(0,n)};t.value=t.value.replace(/[^\d]/g,'');
        }
    </script>
    <script>
        function update_politic(value){
            var name=document.getElementById("name").value;
            var college=document.getElementById("college").value;
            var speciality=document.getElementById("speciality").value;
            var banji=document.getElementById("banji").value;
            var grade=document.getElementById("grade").value;

            if(name==""||name==null||college==""||college==null||speciality==""||speciality==null
                ||banji==""||banji==null||grade==""||grade==null){
                layer.msg("*为必填项",{icon:2,time:2000});
                return;
            }
            layer.confirm("确认提交吗",{btn:['确定','取消']},function(){

                var url="${ctx}/RecorderManage/recorder_manage_update.do";
                var parameter={YHZH:value,name:name,college:college,speciality:speciality,banji:banji,grade:grade};
                $.post(url,parameter,function(data){
                    if(data=="修改成功"){
                        layer.msg(data,{icon:1,time:2000},function(){
                            parent.location.reload(true);
                        })
                    }else{
                        layer.msg(data,{icon:2,time:2000});
                    }
                })
            })
        }

    </script>
</article>


</body>

</html>